class Stack():
    def __init__(self):
        self.stack = [] #列表实现栈

    def push(self, value):
        self.stack.append(value)

    def pop(self):
        return self.stack.pop() #列表的pop方法

    def empty(self):
        return len(self.stack) == 0

    def top(self):
        if self.empty():
            return "Stack is empty"
        return self.stack[-1]

    def size(self):
        return '长度是：%d'%len(self.stack)

if __name__ == '__main__':
    s = Stack()
    s.push(1)
    s.push(2)
    s.push(3)
    print(s.stack)
    print(s.top())
    s.pop()
    print(s.stack)
    print(s.size())
    s.pop()
    s.pop()
    print(s.stack)
    print(s.top())